//
//  View2Controller.m
//  app
//
//  Created by KL on 16/12/27.
//  Copyright © 2016年 KM. All rights reserved.
//

#import "View2Controller.h"

@interface View2Controller ()
{
    NSArray *d;
}
@end

@implementation View2Controller

- (void)viewDidLoad {
    [super viewDidLoad];
    d = [NSArray new];
    NSMutableArray *re = [NSMutableArray new];
    for(NSString *item in _data) {
        if(item == _text)
        {
            [re addObject:item];
        }
        else if([_text hasPrefix:@"d"]&&[item hasPrefix:@"d"])
        {
            [re addObject:item];
        }
        else if([_text hasPrefix:@"s"]&&[item hasPrefix:@"s"])
        {
            [re addObject:item];
        }
        else if([_text hasPrefix:@"c"]&&[item hasPrefix:@"c"])
        {
            [re addObject:item];
        }
        else if([_text hasPrefix:@"q"]&&[item hasPrefix:@"q"])
        {
            [re addObject:item];
        }
        else if([_text hasPrefix:@"z"]&&[item hasPrefix:@"z"])
        {
            [re addObject:item];
        }
        else if([_text hasPrefix:@"w"]&&[item hasPrefix:@"w"])
        {
            [re addObject:item];
        }
    }
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 1;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
    return cell;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
